__all__ = ["Database", "database"]

# Chose which database API we want
from sourcerpg.database.consts import DATABASE_API, DATABASE_PATH
from sourcerpg.logging import logger, loglevels

logger.log("Initialising database API: %s" % DATABASE_API,
    level=loglevels.INFO_LEVEL_1)

module = __import__("sourcerpg.database.api.%s" % DATABASE_API,
    fromlist=["database"])
Database = module.Database
database = Database(DATABASE_PATH.joinpath("data.db"),
    DATABASE_PATH.joinpath("sourcerpg_install.dbxml"),
    DATABASE_PATH.joinpath("sourcerpg_install.dbmeta"))
